<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<link rel="stylesheet" type="text/css" href="css/style.css" />
		<link rel="stylesheet" type="text/css" href="css/aui.css" />
		<script src="js/wxrem.js" type="text/javascript" charset="utf-8"></script>
		<!--<script src="//s.url.cn/qqun/qun/qqweb/m/qun/confession/js/vconsole.min.js"></script>-->
        <script src="js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="js/common.js" type="text/javascript" charset="utf-8"></script>
		<title>蜜读-全球好书精读</title>
		<style type="text/css">
			
			body,html{
				height:auto;
				padding-bottom: 2rem;
				background-color: white;
			}
			
			body:before {
				border: 0;
				display: block;
				height: 1px;
				content: '';
			}
			.hide {
				display: none;
			}
			
			.activity-img {
				width: 100%;
			}
			
			#warn{
				background: rgba(0, 0, 0, 0.7);
				text-align: center;
				border-radius: 0.26rem;
				color: white;
				position: fixed;
				z-index: 1000;
				top: 45%;
				left: 25%;
				width: 50%;
				height: 4rem;
				font-size: 1.4rem;
				line-height: 4rem;
				display: none;
			}
		</style>
	</head>
	<body>
		<div class="center">
			<div class="activity-img">
				<img src="img/activity_receivevip_img01.png" / style="width: 100%;">
			</div>
			<div class="activity-img">
				<img src="img/activity_receivevip_img02.png" / style="width: 100%;">
				<div class="phoneView" style="height: 28.0rem; top: 32rem; right: 3rem;left: 3rem;position: absolute;">
					<p align="center" style="font-size: 1.4rem; color: #333333;margin-top: 2.5rem;">每年新增<span style="font-size: 1.5rem; color: red; font-weight: bold;">300+</span>节精品课</p>
			        <p align="center" style="font-size: 1.4rem; color: #333333;margin-top: 1rem;"><span style="font-size: 1.5rem; color: red; font-weight: bold;">500+</span>本好书解读，海量内容任意听</p>
			        <div class="phoneBGView" style="width: 84%; height: 5.5rem; margin-left: 8%; margin-top: 3.0rem; background-color: white; border-radius: 2.5rem;border: .2rem solid black;">
				        <input id="activity_phoneNum" type="tel" placeholder="请输入领取手机号" maxlength="11" style="margin-left: 5%; width: 80%; margin-top: 0.4rem; height: 3.6rem; background-color: white; border: 0; font-size: 1.4rem; color: #333333;" />
			        </div>
			        <div class="receive_success hide" style="width: 84%; height: 8rem; margin-left: 8%; margin-top: 3.0rem;margin-bottom: -2rem;">
				        <p class="phoneLab" align="center" style="font-size: 1.6rem; font-weight: bold; color: #333333;"></p>
				        <p align="center" style="font-size: 1.3rem; color: #999999;margin-top: 1.0rem;">*使用微信登录app，绑定此手机号即可使用。</p>
			        </div>
			        <div class="receiveBtn" style="width: 84%; height: 5.5rem; margin-left: 8%; margin-top: 2.5rem; background-color: #f8d44c; border-radius: 2.5rem;border: .2rem solid black;">
				        <p class="receiveLab" align="center" style="font-size: 1.6rem; line-height: 5.5rem; font-weight: bold; color: #333333;">0元领取 <span style="font-size: 1.2rem;"><s>(VIP原价¥365)</s></span></p>
			        </div>
				</div>
			</div>
			<div class="activity-img">
				<img src="img/activity_receivevip_img3.png" / style="width: 100%;">
			</div>
			<div class="activity-img">
				<img src="img/activity_receivevip_img4.png" / style="width: 100%;">
			</div>
			<div class="activity-img">
				<img src="img/activity_receivevip_img5.png" / style="width: 100%;">
			</div>
			<div class="activity-img">
				<img src="img/activity_receivevip_img6.png" / style="width: 100%;">
			</div>
			<div class="activity-img">
				<img src="img/activity_receivevip_img7.png" / style="width: 100%;">
			</div>
			<div class="activity-img">
				<img src="img/activity_receivevip_img8.png" / style="width: 100%;">
			</div>
			<div class="activity-img">
				<img src="img/activity_receivevip_img9.png" / style="width: 100%;">
			</div>
			<div class="activity-img">
				<img src="img/activity_receivevip_img10.png" / style="width: 100%;">
			</div>
		</div>
		<div class="activity-Bottom hide" style="display: block; background-color: #f8d44c; position: fixed; bottom: 0; height: 5rem; width: 100%;left: 0;" onclick="scrollToTop()">
			<p class="receiveLab" align="center" style="font-size: 1.6rem; font-weight: bold; color: #333333; line-height: 5rem;">0元领取 <s><span style="font-size: 1.2rem;">(VIP原价¥365)</span></s></p>
		</div>
		<div id="warn"></div>
	</body>
	<script type="text/javascript">
		$('.activity-Bottom').hide();
		var receive_type = 0;
		if (getCookie('activity_phone')) {
			receive_type = 1;
			$('.phoneBGView').addClass('hide');
		    $('.receive_success').removeClass('hide');
		    $('.phoneLab').text(getCookie('activity_phone') + "手机号已成为会员");
		    $('.receiveLab').text("下载蜜读APP");
		}
		
		function addStatistics(key) {
			$.ajax({
				type:"get",
				url:hostUrl + "activity/draw/execute?" + key + "=" + key,
				async:true
			});
		}
		addStatistics("page");
		
		function scrollToTop(){
			if (receive_type == 0) {
				scrollTo(0,200);
			} else{
				addStatistics("down");
				location.href = "http://a.app.qq.com/o/simple.jsp?pkgname=com.wwdx.readwhat";
			}
		}
		
		$('.receiveBtn').click(function(){
			if (receive_type == 0) {
				var phone=$('#activity_phoneNum').val();
			    var checkPhoneReg = /^1(3[0-9]|4[57]|5[0-35-9]|7[0135678]|8[0-9])\d{8}$/;
			    if(!checkPhoneReg.test(phone) || phone.length != 11){
				    weekTip("手机号输入有误");
				    return;
			    }
			    $.ajax({
				   type: "get",
				   url:hostUrl + "activity/draw/execute?phone=" + phone,
				   success: function(data) {
				   	setLocalCookie('activity_phone',phone);
				   	 weekTip("领取成功");
				   	 receive_type = 1;
				   	 $('.phoneBGView').addClass('hide');
				   	 $('.receive_success').removeClass('hide');
				   	 $('.phoneLab').text(phone + "手机号已成为会员");
				   	 $('.receiveLab').text("下载蜜读APP");
				   }
			   });
			} else{
				addStatistics("down");
				location.href = "http://a.app.qq.com/o/simple.jsp?pkgname=com.wwdx.readwhat";
			}
	   });
	   
	   function setLocalCookie(name, value) {
		var argv = setLocalCookie.arguments;
        var argc = setLocalCookie.arguments.length;
        var expires = (argc > 2) ? argv[2] : null;
        if (expires!=null) {
            	var LargeExpDate = new Date ();
            LargeExpDate.setTime(LargeExpDate.getTime() + (expires*1000*3600*24));
        }
        document.cookie = name + "=" + escape (value)+((expires == null) ? "" : ("; expires=" +LargeExpDate.toGMTString())); 
       }

        //取回cookie
	    function getCookie(c_name){
		   if (document.cookie.length>0){
		       c_start=document.cookie.indexOf(c_name + "=")
		       if (c_start!=-1){ 
				  c_start=c_start + c_name.length+1 
				  c_end=document.cookie.indexOf(";",c_start)
				  if (c_end==-1) c_end=document.cookie.length
				  return unescape(document.cookie.substring(c_start,c_end))
			   } 
		   }
		  return ""
	    }
	    
	    $(window).scroll(function(){
			if ($('body').scrollTop() >= 620) {
				$('.activity-Bottom').removeClass('hide')
				$('.activity-Bottom').fadeIn()
			} else{
				$('.activity-Bottom').fadeOut()
			}
		})
	</script>
</html>
